package main

import "fmt"

func fibonacci() func() int {
	prepre, pre := 0, 1
	return func() int {
		now := prepre
		prepre, pre = pre, pre+prepre
		return now
	}
}

func main() {
	f := fibonacci()
	for i := 0; i < 10; i++ {
		fmt.Println(f())
	}
}
